package com.ethank.enums.ali;

import com.ethank.entity.VoucherResponseVO;

import java.util.ArrayList;
import java.util.List;

/**
 * @author tf
 * @date 2024-03-22
 * @Description type  1- input 文本 2-picker date日期 3-picker time 时间 4-pick dateTime 年月日时分秒
 */
public enum TrainTicketEnum {
    BillINVOICETYPE("type", "火车票", "", 1, true),
    DEPARTURESTATION("departureStation", "出发站", "", 1, false),
    ARRIVALSTATION("arrivalStation", "到达站", "", 1, false),
    TRAINNUMBER("trainNumber", "车次", "", 1, true),
    DEPARTURETIME("departureTime", "开车时间", "", 2, false),
    SEATNUMBER("seatNumber", "座位号", "", 1, false),
    FARE("fare", "票价", "", 1, true),
    SEATTYPE("seatType", "座位类型", "", 1, false),
    PASSENGERINFO("passengerInfo", "旅客信息", "", 1, false),
    PASSENGERNAME("passengerName", "旅客姓名", "", 1, true),
    TICKETNUMBER("ticketNumber", "票号", "", 1, true),
    TICKETCODE("ticketCode", "售票码", "", 1, true),
    SALEINFO("saleInfo", "售票车站信息", "", 1, false),
    TICKETGATE("ticketGate", "检票口", "", 1, false);

    private String key;
    private String label;

    private String value;
    private Integer type;
    private boolean require;
    private TrainTicketEnum(){
    }

    TrainTicketEnum(String key, String label, String value, Integer type, boolean require) {
        this.key = key;
        this.label = label;
        this.value = value;
        this.type = type;
        this.require = require;
    }


    public String getKey() {
        return key;
    }

    public void setKey(String key) {
        this.key = key;
    }

    public String getLabel() {
        return label;
    }

    public void setLabel(String label) {
        this.label = label;
    }

    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public boolean isRequire() {
        return require;
    }

    public void setRequire(boolean require) {
        this.require = require;
    }

    public static List<VoucherResponseVO> convertVoucher() {
        ArrayList<VoucherResponseVO> vos = new ArrayList<>();
        for (TrainTicketEnum fieldEnum : TrainTicketEnum.values()) {
            VoucherResponseVO vo = new VoucherResponseVO();
            vo.setKey(fieldEnum.getKey());
            vo.setLabel(fieldEnum.getLabel());
            vo.setType(fieldEnum.getType());
            vos.add(vo);
        }
        return vos;
    }

}
